home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / ditroff / tmac.sprite < prev    next >
Encoding:
Text File  |  1991-10-31  |  4.5 KB  |  214 lines

  1. .\" This file contains extra Ditroff macros used in Sprite man pages:
  2. .\"
  3. .\" .HS name section [date [version]]
  4. .\"    Replacement for .TH in other man pages.  See below for valid
  5. .\"    section names.
  6. .\"
  7. .\" .LG
  8. .\"    Increase font size;  opposite of .SM
  9. .\"
  10. .\" .AP type name in/out [indent]
  11. .\"    Start paragraph describing an argument to a library procedure.
  12. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  13. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  14. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  15. .\"    needed;  use .AS below instead)
  16. .\"
  17. .\" .AS [type [name]]
  18. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  19. .\"    name are examples of largest possible arguments that will be passed
  20. .\"    to .AP later.  If args are omitted, default tab stops are used.
  21. .\"
  22. .\" .BS
  23. .\"    Start box enclosure.  From here until next .BE, everything will be
  24. .\"    enclosed in one large box.
  25. .\"
  26. .\" .BE
  27. .\"    End of box enclosure.
  28. .\"
  29. .\" .VS
  30. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  31. .\"    of man pages.
  32. .\"
  33. .\" .VE
  34. .\"    End of vertical sidebar.
  35. .\"
  36. '    # Heading for Sprite man pages
  37. .de HS
  38. .PD
  39. .DT
  40. .AS
  41. .if n .nr IN .5i
  42. .if t .nr IN .5i
  43. .nr LL \\n(.l
  44. .ds ]S UNKNOWN SECTION (\\$2)
  45. .if '\\$2'cmds'       .ds ]S User Commands
  46. .if '\\$2'lib'        .ds ]S C Library Procedures
  47. .if '\\$2'dev'        .ds ]S Devices
  48. .if '\\$2'tcl'        .ds ]S Tcl Command Language Library
  49. .if '\\$2'admin'      .ds ]S Administrative Commands
  50. .if '\\$2'daemons'    .ds ]S Daemons
  51. .if '\\$2'files'      .ds ]S File Formats
  52. .ds ]H \\$1
  53. .ds ]D \\*(]S
  54. .ie '\\$3'' .ds ]L  Printed:\\ \\ \\*(DY
  55. .el         .ds ]L  Modified:\\ \\ \\$3
  56. .if t .ie '\\$4'' .ds ]W Sprite version 1.0
  57. .if t .el         .ds ]W Sprite version \\$4
  58. .if n .ie '\\$4'' .ds ]W Sprite v.1.0
  59. .if n .el         .ds ]W Sprite v.\\$4
  60. .if !"\\$3"" .ds ]L \\$3
  61. .wh 0 }H
  62. .if t .wh -1i }B
  63. .if n .wh -1.167i }F
  64. .if \\n(nl .bp 1
  65. .em }M
  66. .}E
  67. .DT
  68. .nr )I .5i
  69. .nr )R 0
  70. .ad b
  71. ..
  72. '    # Increase point size 1 tick
  73. .de LG
  74. .ps +1
  75. .it 1 }N
  76. .if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
  77. ..
  78. '    # Start an argument description
  79. .de AP
  80. .ie !"\\$4"" .TP \\$4
  81. .el \{\
  82. .   ie !"\\$2"" .TP \\n()Cu
  83. .   el          .TP 15
  84. .\}
  85. .ie !"\\$3"" \{\
  86. .ta \\n()Au \\n()Bu
  87. \&\\$1    \\fI\\$2\\fP    (\\$3)
  88. .\".b
  89. .\}
  90. .el \{\
  91. .br
  92. .ie !"\\$2"" \{\
  93. \&\\$1    \\fI\\$2\\fP
  94. .\}
  95. .el \{\
  96. \&\\fI\\$1\\fP
  97. .\}
  98. .\}
  99. .DT
  100. ..
  101. '    # define tabbing values for .AP
  102. .de AS
  103. .nr )A 10n
  104. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  105. .nr )B \\n()Au+15n
  106. .\"
  107. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  108. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  109. ..
  110. '    # BS - start boxed text
  111. .de BS
  112. .br
  113. .mk )a
  114. .ds )b 1
  115. .if n .nf
  116. .if n .ti 0
  117. .if n \l'\\n(.lu\(ul'
  118. .if n .fi
  119. ..
  120. '    # Special macro to handle page bottom:  finish off current
  121. '    # box/sidebar if in box/sidebar mode, then invoked standard
  122. '    # page bottom macro.
  123. .de }B
  124. .if '\\*()b'1' \{\
  125. .ev 1
  126. 'ti 0
  127. 'nf
  128. .if t \h'-1.5n'\L'|\\n()au-1.5v'\l'\\n(.lu+3n\(ul'\L'-|\\n()au+1.5v'\l'|0u-1.5n\(ul'
  129. 'sp -1
  130. .ev
  131. 'fi
  132. .\}
  133. .if '\\*()v'2' \{\
  134. .if t \{\
  135. .ev 1
  136. 'ti 0
  137. 'nf
  138. .br
  139. \h'\\n(.lu+3n'\v'-1v'\L'|\\n()bu-1v\(br'\v'-|\\n()bu+2v'\h'|0u'
  140. 'sp -1
  141. 'fi
  142. .ev
  143. .\}
  144. .\}
  145. .}F
  146. ..
  147. '    # What to do when the head of the page occurs during boxed text
  148. '    # or vertical sidebar: update starting position for box/sidebar.
  149. .am }H
  150. .mk )a
  151. .mk )b
  152. ..
  153. '    # BE - end boxed text (draw box now)
  154. .de BE
  155. .sp -1
  156. .nf
  157. .ti 0
  158. .ie n \l'\\n(.lu\(ul'
  159. .el \{
  160. \h'-1.5n'\L'|\\n()au-1.5v'\l'\\n(.lu+3n\(ul'\L'-|\\n()au+1.5v'\l'|0u-1.5n\(ul'
  161. .\"   \h = move left 1.5n
  162. .\"   \L = draw up,   len=  )a units + 1.5v 
  163. .\"    \L draws a line, arg = distance. if negative, draws up.
  164. .\"    The position in reg. )a is used to draw the vertical lines.
  165. .\"      |\\n)au = distance from current loc. to )a (negative distance)
  166. .\"      -1.5v   = distance above )a since there is text at )a's location
  167. .\"   \l = draw right, len= cur. line length + 3n using underrule
  168. .\"   \L = draw down, len=  )a units + 1.5v 
  169. .\"   \l = draw left, back to original spot
  170. .\}
  171. .fi
  172. .br
  173. .ds )b 0
  174. ..
  175. '    # VS - start vertical sidebar
  176. .de VS
  177. .mk )b
  178. .if n 'mc \s12\(br\s0
  179. .if t \{\
  180. .ds )v 2
  181. .\}
  182. ..
  183. '    # VE - end of vertical sidebar
  184. .de VE
  185. .if n 'mc
  186. .if t \{\
  187. .ev 1
  188. .nf
  189. .ti 0
  190. \h'|\\n(.lu+3n'\L'|\\n()bu-1v\(bv'\v'-|\\n()bu+1v'\h'-|\\n(.lu+3n'
  191. .sp -1
  192. .fi
  193. .ev
  194. .\}
  195. .ds )v 0
  196. ..
  197. .\"
  198. .\"  Define the string DY to be the current date
  199. .\"  format:  month day, year
  200. .\"
  201. .if \n(mo-0 .ds MO January
  202. .if \n(mo-1 .ds MO February
  203. .if \n(mo-2 .ds MO March
  204. .if \n(mo-3 .ds MO April
  205. .if \n(mo-4 .ds MO May
  206. .if \n(mo-5 .ds MO June
  207. .if \n(mo-6 .ds MO July
  208. .if \n(mo-7 .ds MO August
  209. .if \n(mo-8 .ds MO September
  210. .if \n(mo-9 .ds MO October
  211. .if \n(mo-10 .ds MO November
  212. .if \n(mo-11 .ds MO December
  213. .ds DY \*(MO \n(dy, 19\n(yr
  214.